package com.kun.auth.properties;

import com.kun.constant.SecurityConstant;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 白名单配置
 *
 * @author kun.li
 */
@Component
@ConfigurationProperties(prefix = "security")
@Data
@RefreshScope
public class WhiteProperties {


    private List<String> ignores;

    @PostConstruct
    public void init() {
        List<String> whiteStaticUrl = List.of(SecurityConstant.WHITE_STATE_URI.split(","));
        ignores.addAll(whiteStaticUrl);
    }


}
